﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="search_my_score.aspx.cs" Inherits="search_my_score" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <style type="text/css">
        .auto-style1 {
            text-align: left;
        }
        .auto-style2 {
            font-size: large;
        }
    </style>
</head>
<body class="auto-style1">
    <form id="form1" runat="server">
    <div>
        <center>
        <br />
            <span class="auto-style2"><strong>
            <br />
            请选择学期:</strong></span><strong><asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" DataSourceID="SqlDataSource1" DataTextField="term" DataValueField="term" CssClass="auto-style2" Height="30px" Width="82px">
        </asp:DropDownList>
            </strong>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="SELECT DISTINCT [term] FROM [Course]"></asp:SqlDataSource>
            <br />
            <br />
        <br />
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" CellPadding="4" DataSourceID="SqlDataSource2" ForeColor="#333333" GridLines="None" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
            <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="category" HeaderText="课程类别" SortExpression="category" />
                <asp:BoundField DataField="Cno" HeaderText="课程号" SortExpression="Cno" />
                <asp:BoundField DataField="Cname" HeaderText="课程名" SortExpression="Cname" />
                <asp:BoundField DataField="score" HeaderText="分数" SortExpression="score" />
            </Columns>
            <EditRowStyle BackColor="#7C6F57" />
            <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
            <RowStyle BackColor="#E3EAEB" />
            <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
            <SortedAscendingCellStyle BackColor="#F8FAFA" />
            <SortedAscendingHeaderStyle BackColor="#246B61" />
            <SortedDescendingCellStyle BackColor="#D4DFE1" />
            <SortedDescendingHeaderStyle BackColor="#15524A" />
        </asp:GridView>
            </center>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:XSXKConnectionString4 %>" SelectCommand="select Course.category,result.Cno,Course.Cname,result.score
from result,Course
where result.Cno=Course.Cno and result.Sno=@Sno and Course.term=@term">
            <SelectParameters>
                <asp:SessionParameter Name="Sno" SessionField="id" />
                <asp:ControlParameter ControlID="DropDownList1" Name="term" PropertyName="SelectedValue" />
            </SelectParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
